const token = 'h5' // token命名为h5
// 存token
export const setToken = (val) => {
  localStorage.setItem(token, val)
}
// 取token
export const getToken = () => {
  return localStorage.getItem(token)
}
// 清除token
export const delToken = () => {
  localStorage.removeItem(token)
}

const MY_CHANNELS_KEY = 'geek-h5-my-channels'

export const setMyChannels = (myChannels) => {
  localStorage.setItem(MY_CHANNELS_KEY, JSON.stringify(myChannels))
}

export const getMyChannels = () => {
  return JSON.parse(localStorage.getItem(MY_CHANNELS_KEY))
}

export const delMyChannels = () => {
  localStorage.removeItem(MY_CHANNELS_KEY)
}
